from appium import webdriver
class Base():
    def __init__(self):
        cap={
            "platformName": "Android",
            "appium:deviceName": "emulator-5554",
            "appium:automationName": "uiautomator2",
            "appium:appPackage": "com.xiachufang",
            "appium:appActivity": ".activity.home.HomeActivity",
            "appium:noReset": True
        }
        self.drivee=webdriver.Remote('http://127.0.0.1:4723/wd/hub',cap)

    def find_ele(self,log):
        ele=self.drivee.find_element(*log)
        return ele
    def huadong(self,a,b,c,d):
        self.drivee.swipe(a,b,c,d,300)
    def anjian(self,a):
        self.drivee.press_keycode(a)




    def huadong(self,a,b,c,d):
        self.drivee.swipe(a,b,c,d,300)